Fixed the crash problem