handle non-function edge case correctly