more error handling and error logs.