more generic code to fix compilation fubar