fix bug in comparing 2 date