fixed viewing an event. included encodeHTML function to escape all htmls before executing them