implemented listen method