preventing limitless redirect