validity should be passed in - different data have different intervals