fixed bug with doubling objects