add non locals to function