added service for closing the popup programmatically