fixes issue #1 - changes callback signature to include an error parameter