fixed small bug in engine