Fix buffer overflow
basic logging