use wrapper function for metadata, add a working test for taskTree