updating views and javascript