corrections to db connection implementation