adds resource caps and blocks double refinement bug