added time range functionality