Added function checking in main plugin file