fixed a selection offset bug