Adding password function to form class