improved update_with_password method