added extra's to the Function class for logging or calling sync instead of async