fixed part of retrieveUpdates being inside the loop when it shouldnt