Add access rules and error handling