add test for subscribe function