Fixing instance thread safety