using database instead of dummy data