fix duplicate objects and leaking properties