fixed bug with connect overwriting values