few bug fixes + thread input

multithread bugfix && specify input