set up listener on server side