trap stdout