It doesn't look like the attachment worked. Make sure that the insert server behavior is not called before the validation code goes through. If the insert server behavior is before the validation code, at the top of the page, then it will insert and then the validation code will run and forward to the page and may be inserting again.