replaced deprecated functions