fix for bug where detaching clears fks