fix how plugin directories are managed