Implemented first error handling