fix javascript for single view