fixed sql errors after header update