We need this if else since apparently lines after startActivity calls() still take time to happen.