Fix permission_check