added some utils for checking origin state, not sure if this really belongs
here