Added functionality for on click event