fixes buffer overflows