get function improved