fix reentrant parsing