debugged a bug caused by c-style ++ operator fail