started working on error handling