fixed the listen method