merging changes from mainwin