fix the accept loop