add test case and functionality for HEAD