Moved Bclose in a plugin file