added promises with Q and rewrite checkline.js