fixing validation bug