prevent app from crashing when invoking plugin callback

Currently the app crashes when invoking plugin callback