use $dispatch to close popup