adding location caching and js version of application