fix bug with start and end dates in balance check