Fixed syntax error (missing then)