close share function