fixed depricated function