header keys function was not called correctly