Working on db wraper where conditions