move validate earlier