Fixed exception bug