added conn.close to some methods