fix resources not being copied in certain situations