fixing temporary password function