else if with cast