fixed lua prepare_headers