fix bug and add validates