added password function in common, validate() implements new changes