Error handling improved with NSError