more error checking enhancements