fix optimization issue