more error checking