better handle multiple terminals