Fix bug in accept header check