fixed contract bug