Add id to query only when not multiple results