fix debug function
move debug function to class Object