fixes to ajax, works now