Changed semi-colon to newline behavior and added null checker