Replaced hardcoded value true with parameter runInBackground.
Added check of null pluginResult that caused app to hang under certain conditions.