Add a check to plugin loading, thanks davispuh