fixed optimizer bug due to duplicate variable representation