added new method to handle by errors