Client side validation and log out