fixed issue with cleanup