If needs else branch in expression of type Unit