updated preference learning optimization to handle bugs