fixed a bug because of closure.