Adding script with mutex over goto statements