fixed mapWriter constructor