Updated for live polling, shitty code but better than refreshing the page