fix for possibly invalid core calculation