Only let the function redirect once