Second commit - changes to error handling