execption handling wrking fine