functionality for popup