Fix to save the hits correctly to the database