Trying to fix optimization issue