1. added time interval in main thread of downloader; 2. added checking database before close downloader