send error codestatus for head request