also migrate this line into if statement