fix validation bug