pete made it work with new changes