more error checking and stuff