Update code so that it works with API version 32.0