bug fix in access function