added password validation code