Add switch to control retry