added better error logging