fixed error with non ajax requests