add more options for production
better error handling