fixed handling unclosed { characters