fixed sheet.js exeptions, integrated with paint.html