fixed validation bug