Add multi-threading