Fixes import submit bug and other import related bugs
Refactoring and fixes to cancel of import bug