Fixed use of depricated function.