Moved subscription code. Bug fix