Fixed resource copying issue