changed hardcoded db access to parametric