exception handeling for rare cases in the agent