fixed deprecated function warning