bug fix:  see http://www.jamesrobertson.eu/bugtracker/2014/jul/20/undefined-method-add-for-nilclass.html