Fixed bug when val is string