ECMS-4514 fix some probme with tearDown in restatom