updated bolus logic

also added database logging