testing of errors in while structure