fix safety code for avoiding unintended ++,--