error checking order fix