fix misplaced parenthesis and setup logic