fixed a bug with middle click during selection