changed the place of the display data function