Solves overwriting of previous database and duplicates bc of time scanned