Added code to remove newline character