Exit works correctly