modified for password hashing checking during authentication