handling tokenmsgerror exception