Checking if redirect neccessary