add while loop for accept