fixed bug in copy_location