fix precondition check