shifting done() to correct location to allow the plugin to fail correctly