check access code and handle exception if not found
minor refactor
WIP