fixed a bug in tostring.JavaScript