clean & fix stdout