recursively print object