fixed a bug in the legenditem