add debug print for signature
handle escape sequence properly