Added where clause to db select