add prepareHeaders method