fix using depricated method