fixed bug when invoke is_valid? twice