fixed creating factories, registered listeners while creating proxy with getCache

fixes #4215