fixed a bug in toString