Why was this moved to the main if() from the else?