added string boundary check

you could seriously fuck up a plc if we don't check this..