Replace deprecated API call in launch hooks