add function createfromstring