Fixes error with copying