Add custom function for popup