* Improved ajax hook to cover more (all?) cases