Fixes dupe objects glitch. Thanks to James Moschou and Andrew Mackenzie-Ross