fixed error in error dispatch when there are no handlers