update logic and save source, wmo to database