fix crashing error