fixed bugs reported by Bob