additional check to prevent weird redirection