fixed the primary shape detection