Update code for newer gem version