adding some error chandling and chaining
my puppet is rusty yo