ERC Limited by S-corp Salaries and Wages not considering COGS wages

When I enter my ERC on line 7C  of my 1120-S 2021 return it exceeds the amount of my S corps Salaries and Wages listed on line 7A and produces a error message. 

The reason is that most of our payroll costs are in COGS.

and not part of salaries and wages.

If I change salaries and wages on line 7a it tells me that my Balance sheet is out of balance.

Not sure how to resolve the issue