getting around mssql race condition