building movieIsValid function