Fix path detection for plugin

Fix path detection for plugins