fix figure placement loop bug