checking if accept headers exist before using it