fix bugs, auto register tasks