pushed Close out into own function.