switched to jquery and fixed boolean issues and debugged like a mofo