added error checking to lesson 5 form