set headers with function