Fixed the fact swapping bug by comparing DOMElements instead of comparing the jquery objects