remove random gen, add more error handling