fix bugs in check access