Numerical control of the hourglass instability