replace deprecated function with valid one