Update class.php

Added redirect function