Fix permalink validity condition