a minimum working solution with bugs on object copy