fixed a small bug that caused a crash