Made changes according to the new exceptions added by akshay