correct end cap rendering logic