test err first