updated depreated function