fix some issues in deploy stage