fixed javascript bugs and typos, prototype using jspdf is fully working