fixes bug with javascript reading extra string characters