checks for input length

I added checks for the user input length to fix errors in the insert
query when the input is too long