Fixed paint.js bug