fix javascript in product view and added protected view feature