added on resume and on close