using try cache replace if condition, more stable