resource cleaning mechanism added