fixed a strange bug with the endlist attribute not being set.