added clear global functionality