Updated load data function.