add valid check when you upload