improved to work with new version