fixed resource copying