enhance auto deploy logic