implemented pub/sub system to properly render views