Added auto install for pm2 and some error checking