updated subscribe code