Found bug(last paren in new line and user defined function)

How to handle user defined function and paren in new line