fixed bug in string substition