add funcions to buffer stderr - needed for displaying errors in window instead of to console