Fixed plugin code