updated run script
added error handling in js
added different messages for notifications