updates in error checking