#9: fix optional check
#9: adjustment for local date