Made it work with new structure