set extent within data function