Added setting to turn automatic sorting on or off