correcting entry-test and adding error checking