fixing resource copying issues