fix undefined method `[]' for nil:NilClass, Issue#66