task wait/return functions added