adding mysql locking