Check "is_string" can be unreliable.
Better to change the condition to be "is_callable()".