Added wraparound for entities