fix javascript then done