Corrected code example to version 2.x style