changed global errorMessage to property