Fix bug where date is not being used