better position update and header for ajax in layout.js