fixed multithreading bug with attaching to jvm