Updated the code for Drupal 9 compatibility.
Thanks!