Change throw to error