fix bug. add exception raising part