multi instance task support and bug fixes