better error testing