fixes #3816 Need to validate file exist before import tags

Fixed the issue and committed code for review. Please check it.