corrected a bug in the excpetion