I replaced 'unless object.nil?' by 'if object'