adding proper error handling for prod.