Fix undefined method split for nil:NilClass