Insert a failure callback

Because I want to display an alert if the file could not be opened, i have added a failure callback to the plugin.