Add the protected code and fix the crash issue