fix crashing issue