fixed bugs caused by some scala classes