Fixed segment selection bug caused by cashed javascript