fix bug where popup/loading aren't defined