Colin has it right with the links above, ad some foil resist to the ink.
Another thing though, waterbase shouldn't stick to foil if properly cured, we had the same issue and just did less pressure when foiling, and it solved that issue. Maybe dial back your pressure, up your time.