improved error logging
improved error logging