added allowed hosts setting and tweaked others