added a couple of header checks