ajax+some other fixes