bug with date comparison - fix #47