replace stringify "hack" with a simple typeof

the original "stringify" hack is not working and broken beyond repair.