fixes to ajax handlers