fixed plugin directory detection