Fix update task bug and clean ajax call