fix ids clause