Made the activity termination to remove the last empty line in its output.