fixed a bug when date is not provided