proxy function improved