fix optimization