moved javascript redirect to the head