added callback function for nav click