added sid check