change standalone implementation, using Thread join