added password check and hased pwd