make sure func is not nil