fix function deprecated