Fixed Optimize method for not iterator.