debugging undefined method title for nil:NilClass