changed throw to return