Fixed problem with api changes