added better debugging