fixed bugs in parsing, added if filtering without braces