Fixes buffer overflow error