Make sure the INSERT completes before trying the SELECT