fix logic to not use function pointer
typo fix