updated and fixed plugin