Working on fixing loading
Wait function added