Fixed Multi-threading Dead lock