added id checks