added beforeFirstEntity, afterLastEntity in EntityHandler