use local require in write method instead of global require