Fixing edit code