changed method of keeping console open