Changed to way I was checking the origin and ids