Fixed the infinite loop problem on a misplaced paranthesis