replaced deprecated functions with new ones