adding additional error handeling and form validation to login page