Fixed missing permission check