Change onexit behavior