fixed check_access and removed debugflag