added fixes to accommodate page caching