change substr method to substring  on dot click