made decorator on funcs with nonlocal statement