fix resource copying issues