Add scan file function