fix random err https://github.com/rails/rails/issues/14664