fixing trend logic.