Remove unnecessary if statement in db_check and add an else statement in location_lookup to monitor flow