terminate and some fixes, todo: getBuffer X