Handle normal exit