internal functions for correctLF