updated client code less hacky now. using backround workers