added popup menu and fixed callback for new data using a ref for ews