rectified logic of username password validation