Fix exception with join thread in print