Added permission checking'