Added recognition and error handling for debug