Ensure lengths of inputs before db insertion.