retrieving working properly, only server needs to loop correctly