Fixed raise error bug