improve autofit plugin.