fixes to unlockonformunload