Added .value to error handling