move the is_string check first since most usage of this function are string based