adding join for the thread, but lock