Fixed the crashing error