adjusting functionality for on click of permalink