Attempted to fix bug with use of jquery $.off()