add get/head check to error handler