Fix bug in not copying after error