basic multi-threading support added