add close btn, refactored scopes