remove logging and update history query