fixed the undefined static in reentrant functions