validation for guest login and regular login improved