Move mod bug fix inside closure