Changed it such that substring for cosm now works on xively.