start and end dates bug fix