fixed bug where autodirect always happened and added some links to HTML