thorw exceptions instead of printing