fixed bug in defining timed_funs