Fixed Add Machine that was not working for most browsers

Fixed Add Machine that was not working for most browsers by replacing startWith with substring.
StartWith function: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith#Browser_compatibility