My computer was the problem, the code works now.