added js to control views