multi-threading added