changed to sync probably a lot of bugs