fixed double click problem and changed highlight function