fix the fixup function