switched to using $location service for redirect