reorder to avoid NPE