replaced depricated functions