correctly updates but crashes after the model becomes empty