Updated change password logic