Replace hardcoded plugin directory path with function call to get plugin directory