added error logging support