add output buffering to remove warnings