Fix wrong variable for access to DB