add lock to new task api