fixed a bug with the selection tool
merged