search insert position - fix a bug