fixed an excess srand that was causing bad flags