Close gracefully pyying