added more cleanup code

Signed-off-by: abbr <wenfred@gmail.com>