added handling for HEAD requests