moved output change logic