Prevent buffer overflow