fixed problem with ajax and $location