Add code which create connection and open file