Need to create the object inside the if