fixed implementation of all()