renamed variables, added test for error messages