They are both correct. Grammar books will tell you that one or the other is correct, depending on whether it's British or American English, but in reality both are fine.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.