use done instead of success in js