js fix and TODO