Added some error handling in init.sh file