updated report function with date validation