Use mrblen for thread safety