fix sample data function