updated origin check