Fixing edit button enabling logic