add not-object check to string#template