fixed problem with day equal to 0.