Change redirect to javascript