add smartscan and add hooks to prog-mode