Fixed the restirctAccess bug that was created when i input the function