Updated logic statement in access check function