implemented DB access