added ability to add an on_error function to check instances