Fixed warning about using depricated method.