Added empty stage handling