Added lock to PrintNewLine