close connection for activerecord