fix positive mod bug