add allocate handler and changed the task timeout