fix problem where JS GUI fails to recognise locations and only chooses localhost

fixes #1261