BUGFIX: correct monkey patch not to attempt to write on nil