Fix to print and adding counter to Firebase