fixing resource copying issue