Added additional error logging