rearranged validation