adds error routine for invalid entry