simpler error checking