fix db select