add index access of string
bug fixes and remove useless codes