fixed a corruption bug