Fixing error when ->allowPublic is missing in calling controller