fixed bug with duplicating