js assignment

Final refining done
atleast show an error alert to user, stating there is some error