Adding missing if statement