added error logging ;)