kinda works now, some problems with a non-responsing terminal upon termination