update to use delegate rather than block