add error handling to test