Fix a critical bug that caused a crash after changing password