add some changes for header and database access