minor changes to fix crashing issue