closing outside the if allows it to be closed always...