Fixed missing permission variable bug.