fix using error variable that doesnt exist