update code to work with current version