add password check and it's error code