add exception control