fixes #4708 - Prefix ambiguous id in query