did some brainstorming and figured out why getCount won't work its because the function is assynchronous and figureout away around it

.on(){

if notsubmited {
//all the code in submit event

notsubmited = false
else
disconnect from the firebase