fix last date issue