fix throwing errors