Fixed conection
Fixed file overwriting