Fixed crashing due to illegal read operation