fixing problem with copy operation