properly handle head requests