write to DB after 500 tracks