no implicit conversion from nil to integer