Fixed returned type for getErrorMessage