add string readlen arg to avoid recurcive loop