fixed password change
cleaned up code