change from json response to redirect