fix improper error checking