fixed bug in replace call to remove parentheses