define executes before condition, which caused a bug when pn was none