Preventing illegal accesses