added in a separate validate method for password