Worked on error handling