Added missing if statement