search insert position - fix bugs