Added condition to the permit method