few bug fixes + thread input