wrote functions for password recovery