fixed firebase bugs