using throw new Error(string) instead of throw string