add function for changing timerange