Added Firebase logic