replace deprecated functions