add conditional on window.location redirect