changed the get data function