add a decorator that wraps functions