Close the logic