Now properly closing and refreshing after creating a new deployment