Fix code for latest version