changed header so that it does not access database for every page