changed get data function