optimization don't work correctly