made dynamic the loading of head and foot