Added check for form length