fixed missing "then"