- improved error checking