try/catch for rex error