fixed error in model with splice where I was using the returned array instead of the element