template update to handle scrolling