Upgraded version, fixed exception bug