fix stupid free bug and remote debug print