Fixing edit item bug