added error handling. added hours stats and day stats