handles exception when wrong token