add null check for closeConn