added error loggin in alert on errors --KW