Added select from db function