Forgot to declare variable. I don't know why it works without declaring shit, but javascript is weird. I'll declare it anyways 'cause you never know what could happen.