Fixed local reference to db