added valid parentheses