bugfix: failed when the last char in the config is not a newline