fixed conn.close bug