update close method from jlaine