Tested locally using emulater