Added a a guard to prevent init code being called before plugin activation