fix bug with day offset