return null when invalid instance id

Ref #509