fixed few issues about plugin deletion