a better error message (instead of 'Cannot call method toString of undefined'