fix missed then keyword