fixed isValid()