Fix empty date issue