implemented head request handling