adding events listener according to the change on the server