changed return type of db query function.