Invitation class error length is undefined