Fix crash when moving items