fix stdout logging crash