fixed issues reported by Daniel