fixed bug that was causing the program not to write to the config file the last position, under certain circumstances