Added checks to token in header