validate form data at login