Adding event listener for paths.