added autosort mode