clean up. fixed jquery error: "cannot set property of null".