fixed polygon collision and added mutex