sort is back to working, was because i hadn't declared the id's as being global